Skip to content

fix(security): resolve open code-scanning & Dependabot alerts - #1398

Merged
pathosDev merged 4 commits into
developfrom
fix/security-and-quality-alerts
Sep 1, 2026
Merged

fix(security): resolve open code-scanning & Dependabot alerts#1398
pathosDev merged 4 commits into
developfrom
fix/security-and-quality-alerts

Conversation

@pathosDev

@pathosDev pathosDev commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

Clears the open GitHub Security & quality items on actor-ts (6 CodeQL code-scanning alerts + 4 Dependabot alerts), and additionally patches two advisories npm audit surfaced in the example apps so all four front-ends are audit-clean.

Code scanning (CodeQL security-and-quality)

# Rule Sev Resolution
11 js/file-system-race High scripts/build-devtools-ui.mjs — read the generated module via try/catch instead of existsSync()+readFile before the write (removes the TOCTOU check→write pair)
10 js/file-system-race High docs/scripts/scaffold.mjs — write stubs with the wx flag (atomic EEXIST) instead of existsSync()-then-write
15 js/log-injection Med examples/voice/static/plain/index.html — log only a sanitized message kind, never the raw server payload
13 js/missing-origin-check Med src/worker/WorkerNode.tsdismissed as false positive + explanatory comment
12 js/missing-origin-check Med src/testkit/internal/ParallelMultiNodeBootstrap.tsdismissed + comment
14 js/missing-origin-check Med tests/smoke/fixtures/parallel-mns-worker-throws-after-ready.mjsdismissed + comment

The three missing-origin-check findings are in dedicated Worker / worker_threads message handlers, where postMessage origin does not apply (messages come only from the trusted parent that spawned the worker; payloads are validated by kind). Dismissed via API with that justification; comments document why.

Bundle regen: build-devtools-ui.mjs is part of the DevTools UI freshness hash (sourceHash() digests the build script itself), so the #11 fix invalidated the committed source-hash. A commit regenerates the embedded bundle via bun run build:ui; only the source-hash header line changes — assets are byte-identical — and check:ui passes.

Dependency updates (Dependabot + npm audit)

Package Advisory Where
nanoid 3.3.18 GHSA-2v37-7h3g-55p8 (High) {voice,chat}/frontend-next and {voice,chat}/frontend-svelte
cookie 0.7.2 GHSA-pxg6-pf52-xh8x (Low, dev) {voice,chat}/frontend-svelte (via overrides, since kit constrained ^0.6.0)
@sveltejs/kit 2.70.3 GHSA-29g2-3rmr-qm68 (ReDoS) {voice,chat}/frontend-svelte

Both package-lock.json and bun.lock are updated in every case. The frontend-next bun.lock next bump (16.2.12 → 16.3.3) is the lockfile catching up to the existing package.json ^16.3.0. After this, npm audit reports 0 vulnerabilities across all four example front-ends.

The nanoid (svelte) and @sveltejs/kit ReDoS advisories were not in GitHub's original Dependabot alert list; they were included here at the maintainer's request so npm audit is fully clean.

Verification

  • node --check on all edited .mjs; TS edits are comment-only; bun run check:ui passes after regen.
  • npm audit clean in all four example front-ends (nanoid/cookie/kit confirmed in npm and bun lockfiles).
  • CodeQL re-scans this PR; alerts 10/11/15 clear on merge to develop, 12/13/14 stay dismissed.

🤖 Generated with Claude Code

pathosDev and others added 2 commits August 31, 2026 20:05
- js/file-system-race (High): remove TOCTOU in build/docs tooling
  - build-devtools-ui.mjs: read the generated module via try/catch
    instead of existsSync()+readFile before the write
  - scaffold.mjs: write stubs with the 'wx' flag (atomic EEXIST) instead
    of existsSync()-then-write
- js/log-injection (Med): log only a sanitized message `kind` in the
  voice plain example, never the raw server payload
- js/missing-origin-check (Med x3): document why origin checks do not
  apply to dedicated Worker / worker_threads handlers (WorkerNode,
  ParallelMultiNodeBootstrap, smoke fixture); these alerts are dismissed
  on GitHub as false positives.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolves 4 Dependabot alerts in the example apps:
- nanoid -> 3.3.18 (GHSA-2v37-7h3g-55p8, High) in voice/chat frontend-next;
  both package-lock.json and bun.lock. The bun.lock next bump
  (16.2.12 -> 16.3.3) is the lockfile catching up to the existing
  package.json range (^16.3.0); package.json itself is unchanged.
- cookie -> 0.7.2 (GHSA-pxg6-pf52-xh8x, Low, dev) in voice/chat
  frontend-svelte via an `overrides` pin, since @sveltejs/kit constrains
  cookie to ^0.6.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
// js/log-injection).
const kind =
typeof m?.kind === 'string' ? m.kind.replace(/[^\w.:-]/g, '') : '(unknown)';
console.debug('unhandled server msg kind:', kind);
pathosDev and others added 2 commits September 1, 2026 09:55
scripts/build-devtools-ui.mjs is part of the DevTools UI freshness hash
(sourceHash() digests the build script itself), so the file-system-race
fix invalidated the committed source-hash and tripped `check:ui`. Rebuilt
via `bun run build:ui`; only the source-hash header changes — the embedded
assets are byte-identical.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-up covering two advisories npm audit flagged that were not in the
original Dependabot alert set:
- @sveltejs/kit -> 2.70.3 (GHSA-29g2-3rmr-qm68, ReDoS in content
  negotiation) in voice/chat frontend-svelte.
- nanoid -> 3.3.18 (GHSA-2v37-7h3g-55p8, High) transitive in the same
  svelte examples.

Both package-lock.json and bun.lock updated; `npm audit` now reports 0
vulnerabilities across all four example front-ends.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pathosDev
pathosDev force-pushed the fix/security-and-quality-alerts branch from 30a1c0c to bf2eb8e Compare September 1, 2026 08:25
@pathosDev
pathosDev merged commit 5666ba0 into develop Sep 1, 2026
54 checks passed
pathosDev added a commit that referenced this pull request Sep 1, 2026
fix(security): recognised sanitizer for js/log-injection (follow-up to #1398)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants